package com.jisf.driver.auth;

import com.jisf.driver.response.Result;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Classname MyLogoutSuccessHandler
 * @Description TODO 注销成功的处理器
 * @Date 2022/4/4 23:01
 * @Created by jisf：【429627912@qq.com】
 */
@Component
public class MyLogoutSuccessHandler extends JsonAuthentication implements LogoutSuccessHandler {
    @Override
    public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
        Result result = Result.ok("注销成功");
        this.WriteJSON(request, response, result);
    }
}
